# encoding: utf-8
"""
@author: 夏洛
@QQ: 1972386194
@file: 03-mongo.py
"""

import pymongo

client = pymongo.MongoClient()

db = client.xxx
collection = db.xxxx

student1 = {
    'id': '20170101',
    'name': 'Jordan',
    'age': 20,
    'gender': 'male'
}

student2 = {
    'id': '20170202',
    'name': 'Mike',
    'age': 21,
    'gender': 'male'
}
# 牢记一下       数据格式一定要是字典
result = collection.insert([student1, student2])



